package ntd.util.frame.javacv.factory;

import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil;
import ntd.util.frame.javacv.bo.FactorStandardBean;
import ntd.util.frame.javacv.bo.WaterBean;

import java.util.List;

public class FactoryWaterStandard {
    public static List<WaterBean> waterBeans;

    public static List<WaterBean>  initWaterStandardBeans(){

        if (ObjectUtil.isNull(waterBeans)) {
            WaterBean waterBean1 = new WaterBean();
            waterBean1.setName("国际一类");
            waterBean1.setLevel("I");
            waterBean1.setLevelNum(1);
            waterBean1.setFactorStandardBeans(ListUtil.toList(
                    new FactorStandardBean().setFactorName("COD").setFactorCode("w01018").setOMax(15),
                    new FactorStandardBean().setFactorName("氨氮").setFactorCode("w21003").setOMax(0.15),
                    new FactorStandardBean().setFactorName("总磷").setFactorCode("w21011").setOMax(0.02),
                    new FactorStandardBean().setFactorName("总氮").setFactorCode("w21001").setOMax(0.2),
                    new FactorStandardBean().setFactorName("高锰酸盐").setFactorCode("w01019").setOMax(2),
                    new FactorStandardBean().setFactorName("pH").setFactorCode("w01001").setOMin(6).setOMax(9),
                    new FactorStandardBean().setFactorName("溶解氧").setFactorCode("w01009").setOMax(7.5)
//                    new FactorStandardBean().setFactorName("电导率").setFactorCode("w01014").setOMax(0),
//                    new FactorStandardBean().setFactorName("浊度").setFactorCode("w01003").setOMax(0)
            ));

            WaterBean waterBean2 = new WaterBean();
            waterBean2.setName("国际二类");
            waterBean2.setLevel("Ⅱ");
            waterBean2.setLevelNum(2);
            waterBean2.setFactorStandardBeans(ListUtil.toList(
                    new FactorStandardBean().setFactorName("COD").setFactorCode("w01018").setOMax(15),
                    new FactorStandardBean().setFactorName("氨氮").setFactorCode("w21003").setOMax(0.5),
                    new FactorStandardBean().setFactorName("总磷").setFactorCode("w21011").setOMax(0.1),
                    new FactorStandardBean().setFactorName("总氮").setFactorCode("w21001").setOMax(0.5),
                    new FactorStandardBean().setFactorName("高锰酸盐").setFactorCode("w01019").setOMax(4),
                    new FactorStandardBean().setFactorName("pH").setFactorCode("w01001").setOMin(6).setOMax(9),
                    new FactorStandardBean().setFactorName("溶解氧").setFactorCode("w01009").setOMax(6)
//                    new FactorStandardBean().setFactorName("电导率").setFactorCode("w01014").setOMax(0),
//                    new FactorStandardBean().setFactorName("浊度").setFactorCode("w01003").setOMax(0)
            ));

            WaterBean waterBean3 = new WaterBean();
            waterBean3.setName("国际三类");
            waterBean3.setLevel("Ⅲ");
            waterBean3.setLevelNum(3);
            waterBean3.setFactorStandardBeans(ListUtil.toList(
                    new FactorStandardBean().setFactorName("COD").setFactorCode("w01018").setOMax(20),
                    new FactorStandardBean().setFactorName("氨氮").setFactorCode("w21003").setOMax(1),
                    new FactorStandardBean().setFactorName("总磷").setFactorCode("w21011").setOMax(0.2),
                    new FactorStandardBean().setFactorName("总氮").setFactorCode("w21001").setOMax(1),
                    new FactorStandardBean().setFactorName("高锰酸盐").setFactorCode("w01019").setOMax(6),
                    new FactorStandardBean().setFactorName("pH").setFactorCode("w01001").setOMin(6).setOMax(9),
                    new FactorStandardBean().setFactorName("溶解氧").setFactorCode("w01009").setOMax(5)
//                    new FactorStandardBean().setFactorName("电导率").setFactorCode("w01014").setOMax(0),
//                    new FactorStandardBean().setFactorName("浊度").setFactorCode("w01003").setOMax(0)
            ));

            WaterBean waterBean4 = new WaterBean();
            waterBean4.setName("国际四类");
            waterBean4.setLevel("Ⅳ");
            waterBean4.setLevelNum(4);
            waterBean4.setFactorStandardBeans(ListUtil.toList(
                    new FactorStandardBean().setFactorName("COD").setFactorCode("w01018").setOMax(30),
                    new FactorStandardBean().setFactorName("氨氮").setFactorCode("w21003").setOMax(1.5),
                    new FactorStandardBean().setFactorName("总磷").setFactorCode("w21011").setOMax(0.3),
                    new FactorStandardBean().setFactorName("总氮").setFactorCode("w21001").setOMax(1.5),
                    new FactorStandardBean().setFactorName("高锰酸盐").setFactorCode("w01019").setOMax(10),
                    new FactorStandardBean().setFactorName("pH").setFactorCode("w01001").setOMin(6).setOMax(9),
                    new FactorStandardBean().setFactorName("溶解氧").setFactorCode("w01009").setOMax(3)
//                    new FactorStandardBean().setFactorName("电导率").setFactorCode("w01014").setOMax(0),
//                    new FactorStandardBean().setFactorName("浊度").setFactorCode("w01003").setOMax(0)
            ));

            WaterBean waterBean5 = new WaterBean();
            waterBean5.setName("国际五类");
            waterBean5.setLevel("Ⅴ");
            waterBean5.setLevelNum(5);
            waterBean5.setFactorStandardBeans(ListUtil.toList(
                    new FactorStandardBean().setFactorName("COD").setFactorCode("w01018").setOMax(40),
                    new FactorStandardBean().setFactorName("氨氮").setFactorCode("w21003").setOMax(2),
                    new FactorStandardBean().setFactorName("总磷").setFactorCode("w21011").setOMax(0.4),
                    new FactorStandardBean().setFactorName("总氮").setFactorCode("w21001").setOMax(2),
                    new FactorStandardBean().setFactorName("高锰酸盐").setFactorCode("w01019").setOMax(15),
                    new FactorStandardBean().setFactorName("pH").setFactorCode("w01001").setOMin(6).setOMax(9),
                    new FactorStandardBean().setFactorName("溶解氧").setFactorCode("w01009").setOMax(2)
//                    new FactorStandardBean().setFactorName("电导率").setFactorCode("w01014").setOMax(0),
//                    new FactorStandardBean().setFactorName("浊度").setFactorCode("w01003").setOMax(0)
            ));


            waterBeans = ListUtil.toList(
                    waterBean1,waterBean2,waterBean3,waterBean4,waterBean5
            );
        }
        return waterBeans;
    }

}
